<?php

namespace App\Models;


class ShopGoodsModel
{
    /**
     * 查询商品
     * entry
     * return array
     * */
    public static function getGoodsInfo($conn,$goods_id){
        $Sql="SELECT `goods_id`,`merchant_id`,`unreal_sales_volume`,`sales_volume`,`goods_type`,`is_top`,`is_adopt`,`is_task`,`name`,`title` FROM `shop_goods` where `goods_id` =$goods_id";
        return $conn->readConn($Sql);
    }
    /**
     * 修改
     * entry $CtcSettingExample
     * return int
     * */
    public static function upShopGoodsInside($conn,$Example){
        $joinSql="";
        if($Example->sales_volume !=null){
            $joinSql.=" `sales_volume` = '$Example->sales_volume',";
        }
        if($joinSql !=null){
            $innerJoin = rtrim($joinSql,",");
            $upUserSql="UPDATE  `shop_goods` SET $innerJoin WHERE `goods_id` = '$Example->goods_id'";
            return $conn->executeConn($upUserSql);
        }
    }
}